<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>05_2.Objects</title>
    <style>
        body {
            margin: 0;
        }
    </style>
</head>

<body>
    <script src="build/three.js"></script>
    <script>
        //生成场景
        const scene = new THREE.Scene();
        //设置相机
        const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
        camera.position.z = 10;
        //设置渲染器
        const renderer = new THREE.WebGLRenderer();
        renderer.setSize(window.innerWidth, window.innerHeight);
        document.body.appendChild(renderer.domElement);
        //生成模型
        const geometry = new THREE.TorusGeometry( 2, 1, 16, 20 );;
   
        //POINTS
        const  points= new THREE.Points(geometry, new THREE.PointsMaterial({ color: 0xff0000,size:0.1 }));
        //Mesh
        const  mesh= new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({ color: 0xffffff }));
        //LINE_STRIP
        const  line= new THREE.Line(geometry, new THREE.LineBasicMaterial({
            color: 0x00ff00,
            linewidth: 1
        }));
       
        //设置场景

        
        scene.add(mesh);
        scene.add(line);
        scene.add(points);
        //渲染场景
        renderer.render(scene, camera);
    </script>
</body>
</html>